IF  EXISTS (SELECT name FROM sys.databases WHERE name = N'PageFlowTestDB')
DROP DATABASE [PageFlowTestDB]

CREATE DATABASE [PageFlowTestDB]


GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [PageFlowTestDB].[dbo].[sp_fulltext_database] @action = 'enable'
end
GO
ALTER DATABASE [PageFlowTestDB] SET ANSI_NULL_DEFAULT OFF 
GO
ALTER DATABASE [PageFlowTestDB] SET ANSI_NULLS OFF 
GO
ALTER DATABASE [PageFlowTestDB] SET ANSI_PADDING OFF 
GO
ALTER DATABASE [PageFlowTestDB] SET ANSI_WARNINGS OFF 
GO
ALTER DATABASE [PageFlowTestDB] SET ARITHABORT OFF 
GO
ALTER DATABASE [PageFlowTestDB] SET AUTO_CLOSE OFF 
GO
ALTER DATABASE [PageFlowTestDB] SET AUTO_CREATE_STATISTICS ON 
GO
ALTER DATABASE [PageFlowTestDB] SET AUTO_SHRINK OFF 
GO
ALTER DATABASE [PageFlowTestDB] SET AUTO_UPDATE_STATISTICS ON 
GO
ALTER DATABASE [PageFlowTestDB] SET CURSOR_CLOSE_ON_COMMIT OFF 
GO
ALTER DATABASE [PageFlowTestDB] SET CURSOR_DEFAULT  GLOBAL 
GO
ALTER DATABASE [PageFlowTestDB] SET CONCAT_NULL_YIELDS_NULL OFF 
GO
ALTER DATABASE [PageFlowTestDB] SET NUMERIC_ROUNDABORT OFF 
GO
ALTER DATABASE [PageFlowTestDB] SET QUOTED_IDENTIFIER OFF 
GO
ALTER DATABASE [PageFlowTestDB] SET RECURSIVE_TRIGGERS OFF 
GO
ALTER DATABASE [PageFlowTestDB] SET  READ_WRITE 
GO
ALTER DATABASE [PageFlowTestDB] SET RECOVERY SIMPLE 
GO
ALTER DATABASE [PageFlowTestDB] SET  MULTI_USER 
GO
if ( ((@@microsoftversion / power(2, 24) = 8) and (@@microsoftversion & 0xffff >= 760)) or 
		(@@microsoftversion / power(2, 24) >= 9) )begin 
	exec dbo.sp_dboption @dbname =  N'PageFlowTestDB', @optname = 'db chaining', @optvalue = 'OFF'
 end
GO
